import React from 'react'
import PropTypes from 'prop-types'
const RightView = (props) => {
  const { children, handleRemoveClick } = props
  return (
    <ul>
      {children.map((item, index) => {
        return (
          <li onClick={() => handleRemoveClick && handleRemoveClick(index)} key={item.name}>
            {item.name}
          </li>
        )
      })}
    </ul>
  )
}

// 设置默认值
RightView.defaultProps = {}
// 校验
RightView.propTypes = {
  handleRemoveClick: PropTypes.func,
}

export default RightView
